Method for assembling fragments of scanned data

ABSTRACT

A method for processing scanned code data, including a plurality of strings, to determine whether the scanned code data is part of a valid code begins by examining a first string of a first scanned code data. A cluster is opened with the first string if the first string contains a start pattern. At least one valid middle portion of the first string is identified and a transition position count associated with the at least one valid middle portion is stored. A second scanned code data is searched for a second string matching at least part of the first string in the cluster. If a match is found, then the second string is added to the end of the cluster. The cluster is closed upon detection of a stop pattern and is then decoded.

CROSS REFERENCE TO RELATED APPLICATIONS

[0001] This application is a continuation of application Ser. No.09/798,117 filed Mar. 2, 2001 which is a continuation of applicationSer. No. 08/482,893, filed on Jun. 7, 1995, which is a continuation ofapplication Ser. No. 07/902,574, filed on Jun. 22, 1992, which issued onNov. 14, 1995 as U.S. Pat. No. 5,466,921, which is a continuation ofapplication Ser. No.07/586,545, filed on Sep. 21, 1990, which issued onJun. 23, 1992 as U.S. Pat. No. 5,124,538, which is a continuation ofapplication Ser. No. 07/237,517, filed on Aug. 26, 1988, which issued onJul. 2, 1991 as U.S. Pat. No. 5,028,772.

BACKGROUND OF THE INVENTION

[0002] The present invention relates to code scanning devices and, inparticular, to apparatus and methods for restoring a code from differingcode fragments.

[0003] Well known equipment exists for reading a bar code that isprinted on a package. Bar codes on merchandise may be scanned at thepoint of sale to identify the goods and correlate them to a price. Suchequipment is commonly used at supermarket checkout counters.

[0004] A basic principle conventionally applied in bar code scanning isthat of detecting reflected light contrasts. A source of illuminationsuch as a low powered helium neon laser, can produce a beam which ismoved across the bar code. Dark areas (bars) absorb laser light, whereaslight areas (spaces) reflect light that is subsequently detected by thescanner.

[0005] Optics are used to “move” a laser beam. Without these optics, thelaser beam appears as a dot. When the optics are used, the beam appearsas a line of laser light. This is defined as moving-beam scanning. Asthe moving beam “travels” across the conveyor (or area to be scanned fora code, commonly called the scanning zone) any light or dark transitionsare detected and converted to a digital signal known as code. A validbar code consists of a defined number of light and dark transitions withcorrect ratios between the wide and narrow intervals.

[0006] Existing codes consist of a series of parallel bars separated byspaces. The bars and spaces are printed at either a full width or halfwidth. The bars and spaces may signify a bit pattern wherein wide spacesor bars are denominated a “one” while narrow spaces and bars aredenominated a “zero” (or vice versa).

[0007] A basic objective in known bar code scanning is laying down atrace that is dense and varied enough to ensure that at least one scanwill recover a complete bar code. The denser the scanning, the morerapidly scanning must occur and, therefore, a higher demand is placedupon the circuitry processing the scanned data.

[0008] Known equipment (for example, U.S. Pat. No. 3,728,677) employs amirrored wheel having a polygonal periphery. Rotation of the mirroredwheel scans a laser beam across two azimuthally spaced mirrors whichdeflect the beam downwardly to trace an “X” shaped pattern.

[0009] Other known equipment has used prisms, mirrors, vidicons, orother apparatus to turn the scan direction of an optical code scanningsystem. (See, for example, U.S. Pat. Nos. 3,663,800; 3,774,014;3,800,282; 3,902,047; and 4,064,390).

[0010] It is also known (U.S. Pat. No.3,906,203) to scan a bar code andmeasure its interval widths by recording the time required to traverseeach interval. The successive interval widths are multiplied by three,five, and eight. By storing and comparing the multiplied widths ofsuccessive scans, the equipment can determine whether the latestinterval is about the same size as, or much smaller or larger than, theprior interval. This equipment, however, performs a relatively coarsecomparison and will accept as valid, scan times that are excessivelyshort or long.

[0011] Accordingly there is a need for a code scanner that does notrequire support from extraordinarily high speed circuitry, but yet has ahigh probability of obtaining a complete code when an object passes bythe scanner.

SUMMARY OF THE INVENTION

[0012] In accordance with the principles of the present invention, ascanner is provided for reading machine-readable code on an object. Thescanner includes a scanning means, a data means, and a registrationmeans. The scanning means can repetitively scan the code and provide ascan signal repetitively corresponding to at least fragments of thecode. The data means is coupled to the scanning means and responds toits scan signal for repetitively storing the scan signal. Theregistration means is coupled to the data means for reconstructing thecode from at least two of the fragments of the code, by relativelyshifting them until they are in registration. Thus, one of the fragmentsprovides a first portion of the code and the other a second portion.Both fragments provide a registered middle portion of the code.

[0013] In accordance with the principles of the same invention, arelated method is provided for reading machine-readable code on anobject. The method includes repetitively scanning the code and obtainingat least fragments of the code. Another step is repetitively recordingthe fragments of the code. The method also includes the step ofreconstructing the code from at least two of the fragments of the code,by relatively shifting them until they are in registration. Thus, one ofthe fragments provides a first portion of the code and the other asecond portion, both providing a registered middle portion of the code.

[0014] By employing methods and apparatus of the foregoing type, animproved scanner is provided. In a preferred embodiment, the scanner canbegin operation when an object passes a checkpoint. Preferably, anoptical scanner measures the distance between transitions from light todark and dark to light. These distances between transitions are assignednumeric values based upon a timing process. A preferred “digital filter”compares the numeric values of successive interval widths. Dependingupon the pattern of the interval widths, a pattern detecting processdetermines whether the measured widths are to be considered wide ornarrow. For example, a ratio test may be used to determine if the widthsare part of a pattern that may be a segment to a bar code.

[0015] All segments of “n” transitions (a value that can be set bysoftware) or more that pass this ratio test are stored as a pattern ofwide and narrow values for a subsequent reconstruction process. Patternsof less than five transitions are rejected. If no pattern has a codethat is sufficiently long to be considered valid, the preferredapparatus attempts to reconstruct code fragments into a complete barcode pattern. The fragments are compared to each other in consecutiveorder. The fragments are overlaid, shifting each subsequent segmentuntil the wide and narrow patterns of the segments match or register.When a complete bar code pattern has been reconstructed from two or morefragments, a microprocessor can decode the reconstructed bar code andverify that its checksum is valid.

[0016] In a preferred embodiment, the code is scanned optically by apattern of staggered “X” shaped traces. These staggered scans may becentered at the vertices of a triangle. By using three “X” shapedpatterns a pattern of modest complexity is used, which has a highprobability of obtaining a full bar code. But if only a fragment of abar code need be obtained, the probability is nonetheless high thatsubsequent fragments will be able to reconstruct the full bar code.

[0017] A method for processing scanned code data, including a pluralityof strings, to determine whether the scanned code data is part of avalid code begins by examining a first string of a first scanned codedata. A cluster is opened with the first string if the first stringcontains a start pattern. At least one valid middle portion of the firststring is identified and a transition position count associated with theat least one valid middle portion is stored. A second scanned code datais searched for a second string matching at least part of the firststring in the cluster. If a match is found, then the second string isadded to the end of the cluster. The cluster is closed upon detection ofa stop pattern and is then decoded.

[0018] A method for processing scanned code data begins by readingscanned code data. Then, string qualifier data is read, including alabel position value and a narrow width value. A determination is madewhether the current scanned data is equivalent to earlier scanned datawith the same label position value and narrow width value. If thecurrent scanned data is not equivalent to earlier scanned data, thenadditional scanned code data is read. If the current scanned data isequivalent to earlier scanned data, then the current scanned data isshifted with respect to the earlier scanned data to determine whether amatching subinterval exists. If no matching subinterval exists, thenadditional scanned code data is read. If a matching subinterval exists,then the shifted current scanned data is stored as a string.

BRIEF DESCRIPTION OF THE DRAWINGS

[0019] The above brief description as well as other objects, featuresand advantages of the present invention will be more fully appreciatedby reference to the following detailed description of presentlypreferred but nonetheless illustrative embodiments in accordance withthe present invention, with reference being made to the followingfigures in which:

[0020]FIG. 1 is a schematic perspective diagram of a scanning means thatmay be used in an embodiment of the present invention;

[0021]FIG. 2A is a plan diagram of the scans produced by the apparatusof FIG. 1;

[0022]FIG. 2B is an elevational view of a scanner employing the scanningmeans of FIG. 1;

[0023]FIG. 3 is a schematic block diagram of the data means andregistration mean that may be used in an embodiment of the presentinvention;

[0024]FIGS. 4A and 4B are timing diagrams illustrating signalsassociated with the apparatus of FIG. 3;

[0025]FIG. 5 is a plan diagram showing successive scans across a barcode;

[0026]FIG. 6 is a state diagram associated with the pattern detectingcircuitry of FIG. 3;

[0027]FIG. 7A is a flow chart showing in a general way the sequence ofoperations of the state means of FIG. 3;

[0028]FIG. 7B is a flow chart schematically illustrating the sequence ofoperations of the microprocessor of FIG. 3;

[0029]FIG. 8A is a block diagram which schematically illustrates thecode scanning system shown in FIGS. 1 to 7;

[0030]FIG. 8B is a block diagram which schematically illustrates analternative embodiment code scanning system in accordance with thepresent invention; and

[0031]FIGS. 9A and 9B are block diagrams of information processingportions of the alternative embodiment system shown in FIG. 8B.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0032] Referring to FIG. 1, it illustrates a scanning means employing asource 10 in the form of a laser beam producing through lenses 12 and14, a narrowly focused coherent beam of light. Lens 12 can be axiallyshifted by a galvanometer 98 which is part of a dynamic focusing system,described in further detail hereinafter. Briefly however, larger objectsscanned by this system appear closer to the scanner while smallerobjects appear further away. By dynamically focusing with lens 12,relatively fine bar codes can be clearly examined by the scanner. Forexample, for code resolution of 0.01 inch, object size is measured byquantizing its size into three inch zones. For each zone transition,lens 12 is axially adjusted 0.001 inch. Of course the specificdimensions applicable in other embodiments will depend upon the specificof the optics employed.

[0033] The beam is reflected by mirrors 16 and 18 and passes throughaperture 20 in beam splitting mirror 22. The beam is thus directed tothe periphery of a deflecting means, shown herein as a rotating mirroredwheel 24. Wheel 24 has twelve, peripheral, mirrored facets, each actingas a rotating mirror. Wheel 24 is driven by a motor (not shown) thatdetermines the scan speed of the laser beam.

[0034] After reflecting from wheel 24 (and depending on the angle of thereflected beam), the beam is then reflected from one of the faces of apair of non-coplanar mirrors, shown herein as first and secondcontiguous mirrors 26. These mirrors 26 are in the shape of a foldedmirror having an obtuse angle facing wheel 24. Accordingly, a beamdeflected by wheel 24 can traverse the peak of mirrors 26 and bereflected right or left to intercept either mirror 28 or 30,respectively. Depending upon which path is taken by the laser beam, oneor the other branches of “X” pattern 32 is produced. As illustrated byreturning rays 34, light may return along the original path of theoutgoing laser beam and be reflected again onto mirror 30 (or mirror28). Thereafter the returning laser light is reflected by mirrors 26,24, and the reflecting side of beam-splitting mirror 22, before reachinga collector lens 36. The light thus collected is focused by lens 36 ontosensor 38 to measure whether a dark or light interval is being scanned.

[0035] The foregoing describes the path for one scan of half of an “X”shaped pattern. The same principles apply to the functioning of theother half of the pattern. In operation, the mirrors are used to splitthe single scan line into two parts. As the mirror wheel 24 rotates athigh speed, beam handling mirrors 26, 28 and 30 cause two lines of the“X” pattern to alternate rapidly. For example: five facets of the mirrorwheel at a slow speed would appear as “\/\/\”. When projected at highspeed, the “X” pattern becomes visible.

[0036] The scan head of FIG. 1 will be supplemented with additionalmirror systems to produce three “X” patterns and each will have separateprocessing electronics of the type described hereinafter. Accordingly,only one “X” pattern need be processed by one circuit. In this preferredembodiment, mirrors 20, 26, 28 and 30 are twice replicated, so thatthree mirror systems are placed at positions spaced 90 degrees apart. Byusing three lasers, three separate “X” shaped scans can be produced.

[0037]FIGS. 2A and 2B show three scans “X” I, “X” II, and “X” IIIproduced by three optical systems each as shown in FIG. 1. In apreferred embodiment, the line of an “X” shaped pattern has a lengthterminating at A and B, for the usable length (80% efficiency) andeffective line length, respectively. These two lengths are for objectsplaced at 28 inches from the scanner. The terminus C represents thetotal physical line length for an object placed at 42 inches from thescanner of FIG. 1. The spacing L1 in the direction of travel, betweenscan “X” I and “X” II, is 2¾″ in the preferred embodiment. The effectivelength L2 of scan line A along the direction of travel is preferably6⅔″. The length L3 in the direction of travel is about 16″. In thisembodiment, the pattern to pattern spacing W1 between “X” patterns in adirection perpendicular to the direction of travel is 4⅔″. Preferably,the usable width W2 along a conveyor would be 16″.

[0038] The cart signal is derived from start and end cart photoeyes40,41. In this embodiment, cart photoeyes 40,41 cover an optical pathwhich when interrupted by an object moving in the direction of travel,produces a signal indicating the need to commence scanning. The spacingof photoeye 40 from endpoints B of patterns “X” II and “X” III (spacingsM1 and M2) are set to ensure complete scanning of the coded object. Itwill be appreciated, however, that all of these dimensions can changedepending upon the size of the code and the relative uncertainty of theplacement or distance of the object or the code on the object to bescanned.

[0039] A typical scanning system will employ a mirror wheel with themirrors on two adjacent sides used to produce the other two “X” patternsin FIG. 2. By using two “X” scanners, a conveyor can be covered with six“X” patterns, and a scanning zone is created to ensure that bar codeslocated on products traveling the conveyor will be intercepted by one ormore of the scanning lines.

[0040] As shown in FIG. 2B, the scanner can be contained in housing Sand supported by bracket BR mounted on platform P above working surfaceW. For a large spacing between platform P and work surface W, there is alarge depth of field required for laser focusing. Accordingly, theheight of an object is determined by the zone detector Z. Relativelysmall objects will not intercept any of the beams associated withphotoeyes Z1-Z7. The next larger class of objects will intercept thebeam associated with photoeye Z1. Successively larger objects willintercept the beams of the other photoeyes, the largest objectintercepting all photoeyes. Zone detector Z produces in response adigital signal indicating the number of zones intercepted. The zone tozone spacing depends on the fineness of the bar codes being examined.For example, an interleaved 2 of 5 bar code with 0.01 inch minimum barwould require the photoeyes to be placed three inches apart from eachother. If the code had a minimum bar size of 0.02 inch, the photoeyeswould be placed five inches apart.

[0041] Referring to FIG. 3, a registration means is shown herein asmicroprocessor board 42 which, in this embodiment, employs amicroprocessor chip such as a type 80286 manufactured by Intel.Microprocessor board 42 is shown coupled to three data means: data means44 and 46, the third data means being more elaborately illustrated. Thethird data means is the balance of the system, excluding blocks 42, 44and 46. In this embodiment, microprocessor board 42 has its own internalmemory. In addition, each data means includes a common memory meansshown herein as dual port, random access memory 48. Memory 48 has oneport constituting data bus DA and address bus AD, both buses coupledbetween microprocessor board 42 and common memory 48. The other portcomprises data bus DATA and address bus ADR. The dual port memory can bea high speed RAM (SRAM) having one kbyte (type IDT7130).

[0042] It will be noted that the buses DATA and ADR allow the automaticupdating of code data and string qualifier data into RAM 48 without theintervention of microprocessor board 42. This frees microprocessor board42 and allows for a very high speed update of code data without beinglimited by the speed of board 42.

[0043] A counter 50 is shown connected to clock input CLK to count it.Counter 50 has a capacity and speed determined by the desired resolutionand scan speed. As further described hereinafter, counter 50 is enabledby terminal CART*SCAN during a scan, after an object is detected by thecart photoeyes (elements 40, 41 of FIG. 2A). The count is determinedjust before the counter is cleared by the transition signal on terminalDEC2. The count accumulated in counter 50 is loaded into the firstregister 52A, an eight bit data latch, by the transition signal onterminal DEC1 in synchronism with the clock input on terminal CLK3.Register 52A is cascaded with registers 52B and 52C which areinterconnected to shift data from register 52A downstream, that is, toregisters 52B and 52C.

[0044] The data loaded into register 52A are compared to an upper andlower limit through limit devices 54A and 54B, respectively, to signalan out-of-range condition. Second and third registers 52B and 52C eachhave their outputs connected to separate inputs of multiplexers 56 and58. The output of multiplexer 56 is applied to the data input of aquantizing means which is shown herein as a programmable read onlymemory 60, organized to act as a look-up means. Memory 60 is actuallycomposed of six sections. Each section responds to the common data inputto produce a signal which signifies a tolerance limit. The limits arethree pairs each centered about a nominal value with a predeterminedtolerance off that nominal value. The three nominal values are the inputvalue multiplied by one, one-half or two. As explained in further detailhereinafter, these tolerances around the nominal values, allowcomparison of successive latched values to determine whether successivescanned intervals are the same, greater or less than the proceedinginterval of the code.

[0045] The three pairs of data limits of the look-up means 60 areapplied to separate inputs of a comparator means 62. Comparator means 62has six digital comparators that compare the output of first register52A against each of the six limit values from memory 60. Accordingly,the recent output of first register 52A can be bracketed (or found notto be bracketable) within limits established by memory 60 as a functionof the earlier values (stored in either second register 52B or thirdregister 52C). The bracketed values are indicated by the six outputlines of comparators 62.

[0046] The outputs of comparators 62 are applied to a pattern meansshown herein as pattern detecting machine 64. In a preferred embodiment,pattern detecting machine 64 includes a XILINX logic configurable arraytype XC2064. This array is a 68 pin CMOS programmable gate array. Suchan array allows implementation of a substantial amount of logic in oneintegrated package. This high speed circuit is able to detect bar widthsas small as four hundred nanoseconds.

[0047] As described in further detail hereinafter, pattern means 64 is anine state machine whose state is determined, in part, by the inputsfrom comparators 62. The other terminals of pattern means 64, CODE,WRXN, CNTZ, XTNDEC, SCAN, CLK and DEC, correspond to: the state of theoptical scan (light or dark), the end of a scan, a clocking event, anextended pulse synchronous with a code transition, the start of a scan,the clock pulse and a non-extended code transition signal, respectively.Pattern machine 64 provides a pair of outputs to control the state ofmultiplexers 56 and 58. The control signal of multiplexer 56 is alsoconnected to one input of memory 60.

[0048] An important feature of pattern means 64 is the register means66. In operation, the logic array of pattern means 64 can set certaindata bits. As explained hereinafter, the successive bits detected in ascanned bar code are stored by the pattern means in register means 66before being transmitted to dual port memory 48.

[0049] Pattern means 64 produces outputs on five control lines 68 to astate means 70 having a logic array similar to that of pattern means 64.In addition, in this embodiment, state machine 70 (operating as acontrol signal state machine) employs three programmable logic arrays(PALS) to enable the various other devices illustrated herein. Controlis effected over control lines 72. The three PALs in state machine 70include one type PAL16R6 and two type PAL16L8 devices. The type PAL16R6device is an array with registered outputs that is used to generatetwenty-three different states that are synchronous with the systemclocks. These states are coded by five binary bits that are the outputsto the combinational logic. Two type PAL16L8 devices are used here toimplement the combinational logic based strictly on the state that thestate machine 70 is in.

[0050] The outputs are a function of only the current state. Thus, thisdesign may be deemed a Moore machine; that is, the outputs are dependenton the previous input history as held in this state, but are notdirectly affected by input values. For this reason, a totallysynchronous control circuit is used to insure freedom from timingproblems.

[0051] Control lines 72 include four inputs to dual port RAM 48.Enabling signals are also provided along lines 72 to empty means 74.Means 74 includes a counter and latch so that the total number of badscans as read on terminal BAD SCANS can be written onto data line DATA.

[0052] A position means is shown herein as label position counter 76, alatched counter enabled by control lines 72. An input is provided fromstate machine 70 along line 72 digitally signifying the position wherethe valid scanned code ends. The count stored on counter 76 can bewritten onto bus DATA.

[0053] A scan means, shown herein as scan number counter 78 isincremented at the start of each scan and enabled by line 72 from statemachine 70. Means 78 is latched so its count can be written onto databus DATA.

[0054] The length of the string stored in register means 66 is loaded bystat machine 70 into string length counter 80. Counter 80 also providesthe facility for counting the consecutive number of transitions wherethe ratio of interval widths is one. Counter 80 also has a data outputto data bus DATA.

[0055] A narrow means is shown herein as latch 81, which stores the dataoutputs from multiplexer 58. As will be explained hereinafter, the valuestored is a value corresponding to the width of a narrow interval asmeasured by counter 50. The output of narrow means 81 is coupled to dataline DATA.

[0056] An address means is shown herein as string data counter 82 andlow string qualifier counter 84. The outputs of counters 82 and 84 areconnected to address bus ADR to indicate a location in dual port RAM 48where data is to be stored. String data counter 82 is used to point to alocation for storing the code bits of register means 66. Counter 84 isused to point to a location in RAM 48 for storing the counts of counters74, 76, 78 and 80.

[0057] A focusing means is shown herein as latches 85 coupled to zonedetector Z (FIG. 2B) and galvanometric focusing device 98 (FIG. 1). Wheninterrogated by microprocessor 42, means 85 transmits a signalcorresponding to the highest zone number intercepted by the objectcarrying the bar code. When focusing number is transmitted bymicroprocessor 42, a latch (not shown) in means 85 is set. This settingis converted by a digital to analog converter (not shown) to an analogsignal that drives the galvanometer in focusing means 98 (FIG. 1).Accordingly focusing of the laser is accomplished under processorcontrol. To facilitate an understanding of the principles associatedwith the foregoing apparatus, its operation will now be brieflydescribed. With laser 10 (FIG. 1) illuminating mirror wheel 24, the “X”pattern 32 is traced. Reflected light and dark bars of a code that fallwithin “X” pattern 32 are reflected back to photo detector 38. As shownin FIG. 5, successive scans from one branch of “X” pattern 32 cantraverse bar code 86 to produce a code signal.

[0058] Referring to FIG. 4A, the previously mentioned clock signal CLKis shown as a number of high frequency square pulses. The response ofphoto detector 38 in the scanner of FIG. 1 is indicated as the outputCODE in FIG. 4A. A D-type flip flop (not shown) is triggered by theclock input CLK to hold the data indicated by signal CODE. A synchronouscode signal is indicated as signal SYNCODE in FIG. 4A. The signalSYNCODE is combined with the clock signal CLK to produce a single pulseDEC1 which begins at the rising edge of signal SYNCODE and ends oneclock pulse period later. A following pulse in signal DEC1 is producedin a similar fashion following the falling edge of signal SYNCODE.Transition signal DEC2 is a pulse delayed by one clock pulse period fromsignal DEC1. The relationship between signal CODE and transition signalsDEC1 and DEC2 are shown on a larger time scale in FIG. 4B.

[0059] Referring to FIG. 3, a code transition causes terminal DEC1 tolatch the current count of counter 50 into register 52A. One clock pulseperiod later, the pulse on terminal DEC2 clears counter 50. Thus, ateach code transition a new count is stored and then cleared so that asubsequent interval can be measured. It will be noted that any valuesstored in registers 52A and 52B are first transferred to registers 52Band 52C, respectively. Therefore between successive transitions, counter50 counts the width of the interval detected by the scanner of FIG. 1.After each transition, the counts then ripple through registers 52A, Band C. Thus, registers 52A, B and C can be considered snapshots of thelast three interval widths as determined by the scanner of FIG. 1.

[0060] Once register 52B has been loaded, a comparison can take place.Initially, register 52B is connected through multiplexer 56 to memory 60to generate six outputs: the input multiplied by ½−20%, ½+20%, 1−20%,1+20%, 2−20%, 2+20% (0.4, 0.6, 0.8, 1.2, 1.6 and 2.4). These values areused to determine if the previous count in counter 52B is about half,equal or double the currently latched count in register 52A. Thus, thememory 60 is used to set a 20% window or tolerance around each value.

[0061] The bottom line (Counts) of FIG. 4B, and Table 1 illustrate howthe counter values latched into registers 52A, B and C are steppedthrough the registers so that bars can be compared to bars and spaces tospaces. Using scan 2B of Table 1 as an example, register 52B wouldcontain a count of 19. The outputs of memory 60 would then be 8, 12, 16,24, 32 and 48. The value in register 52A is compared against the valueof register 52B in this case a first bar (1B) is compared against afirst space (1S). The eighteen count value of register 52A falls,therefore, between a pair of values from memory 60, namely, 16 and 24.In response, the states of comparators 62 would indicate this bracketingto pattern means 64. It will be noted that a bar is compared to a spaceonly in the initial phase when insufficient data is available to comparelike intervals. Comparing like intervals is more desirable since inpractical embodiments of printed bar codes, the width of bars will tendto be equal as will the width of spaces. But bars and spaces will notnecessarily have the same width. TABLE 1 SCAN LATCHES CODE PATTERN TYPESIZE A B C REGISTER COMPARE DATA 1B 19 MSB LSB 1S 18 19 0 2B 22 18 19 001B-1S 2S 18 22 18 19 000 1B-2B 3B 21 18 22 18 0000 1S-2S 3S 17 21 18 2200000 2B-3B 4B 42 17 21 18 000000 2S-3S 4S 19 42 17 21 0000001 3B-4B 5B21 19 42 17 00000010 3S-4S 02 5S 40 21 19 42 00000100 4B-5B 6B 41 40 2119 00001001 4S-5S 6S 18 41 40 21 00010011 5B-6B 7B 22 18 41 40 001001105S-6S 7S 38 22 18 41 01001100 6B-7B 8B 42 38 22 18 10011001 6S-7S 42 3822 00110011 7B-8B 33 42 38 42

[0062] The pattern means 64 determines what binary values should beloaded into the code pattern register 66 in response to the six outputsof the comparator 62. Regardless of the width of the first interval, azero is initially written into register 66, designating the first bar asa zero. The first interval would be subsequently defined as a one bypattern means 64 if the following space was half the value.

[0063] After the next bar is received, the data is shifted in registers52A, B and C, in response to the transition signal on terminal DEC1.Thereafter, the value of register 52C can be compared with the value ofregister 52A. This process enables bars to be compared with bars andspaces with spaces.

[0064] After each comparison, the pattern means 64 determines from theprevious state what to load into register 66 (either a zero or a one). Azero represents a narrow bar or space and a one indicates a wide bar orspace. When eight bits of information are shifted into register 66(creating a byte), the information is written into the dual port RAMmemory 48 by the state means 70. In the example of Table 1, the firstbyte written is 02 (hex). The second byte is 33 (hex).

[0065]FIG. 6 illustrates the pattern detecting algorithm of the patternmeans 64. The machine is a synchronous state machine. A bar or space iscompared to an adjacent or alternate bar or space. If the ratio iseither equal, half or twice (within tolerances), then a valid pattern isfound. A pattern is invalid if none of the above comparisons are true(nothing is stored for invalid patterns). If the number of consecutivevalid ratios exceeds five (up to eight) the numerical representation ofthese patterns, that is a binary string of ones and zeros, is saved inmemory.

[0066] Because of the nature of the algorithm, the pattern detectingmeans 64 is highly fault tolerant. A variable error margin set by memory60, is incorporated with the digital comparator circuit 62 to allow moreflexible comparison of the width of bars and spaces. Because of thiscomparison, it is possible for a bar to vary from another bar by a largepercentage and still be recognized as part of a valid pattern. In mostcases, a bar is compared only with a bar and a space only with anotherspace. This is important because most bar code label printing isbreached, causing the width of the bar to vary considerably with thewidth of the space.

[0067] As shown in FIG. 6, the pattern means 64 (FIG. 3) has a total ofnine unique states, labeled A-I. Pattern means 64 operates on anasymmetric clock identified as terminal XTNDEC (FIG. 3), a pulsegenerated on each transition between intervals and extended for fiveclock cycles. The operation of the pattern means 64 can be divided intotwo halves because only one half of the machine is active at anyinstant, either the left or right half. FIG. 6 clearly shows the twohalves being symmetrical. The left half consists of states C, E, G and Iwhile the right half contains states B, F, D and H. The right half ofthe pattern means 64 is used if the first bar scanned is determined tobe narrow. Otherwise, the left half is active.

[0068] The function of each state is described below:

[0069] State A: Power-on State. Also occurs if comparison is equal inthis state or if any undefined comparison occurs.

[0070] State F: Comparison is twice in state A, state B, or comparisonis equal in state H. Also, comparison is twice AND WINDOW is low (i.e.:no string of more than four transitions is found, no data stored) instate D or state C.

[0071] State D: Comparison is twice in state F or comparison is equal inthis state.

[0072] State H: Comparison is equal in state F or comparison is half instate D.

[0073] State B: Comparison is half in state H or comparison is equal inthis state.

[0074] State G: Comparison is half in state A, state C, or comparison isequal in state I. Also, comparison is half AND WINDOW is low (i.e.: nostring of more than four transitions is found, no data stored) in stateE or state B.

[0075] State E: Comparison is half in state G or comparison is equal inthis state.

[0076] State I: Comparison is equal in state G or comparison is half instate E.

[0077] State C: Comparison is twice in state I or comparison is equal inthis state.

[0078] ZOUT: The signal ZOUT is the output signal from the statemachine. A “one” will be shifted into the shift register for a wideinterval, and a “zero” will be shifted in for a narrow interval. (A“one” means a wide interval.)

[0079] In addition to the functions described above, the LCA of patternmeans 64 also obtains several timing signals to load counters and storedata. TABLE 2 SCAN DATA STRING NARROW LABEL BAD 1 (NO DATA) LENGTH VALUEPOSITION SCAN 2 02 04 09 99 Ø50 0 3 02 33 15 99 Ø50 0 4 02 66 A5 22 20Ø50 0 5 13 34 A7 9C 26 99 Ø50 0 6 9A 53 81 06 26 20 Ø50 0 7 94 E0 0C 2199 Ø45 0 8 70 0C 14 99 Ø40 0 9 0C 07 99 Ø35 0

[0080] State machine 70 (FIG. 3) writes latched data bytes from variousregisters into dual port RAM memory 48. This memory is accessed at thesame time by microprocessor board 42 which permits high speed operation.While the state machine 70 stores the current data from the present scanin port ADR, DATA, the stored data from the previous scan is read by themicroprocessor board 42 at the other port DA, AD.

[0081] Referring to Table 2, on each scan, one or more bytes of dataindicating bar and space widths can be obtained. After the scanned widthdata are written onto bus DATA, the data in the latches and countersconnected to bus DATA sequentially write the indicated string length,narrow value, label position, and the number of bad scans. For example,the third scan produces two data bytes indicating the code pattern ofnarrow and wide bars and spaces. The string length, however, is onlyfifteen bits long, indicating that the last byte has only seven validdata bits. For this scan, the narrow value stored by counter 81 is 99which compares properly with the narrow value of the prior scan, scannumber two. Similarly, the label position from counter 76 is 50 whichcompares properly with the prior label position value.

[0082] In this embodiment, the data bytes indicating the interval widthsare stored between location XF00 and XF1F in the dual port RAM 48. Themaximum that can be saved is thirty-two bytes (i.e. 256 transitions).The following block in memory is the string qualifier data. This blockincludes the narrow value, string length, label position and number ofbad scans. The string qualifier data is stored between memory locationsXF20 and XFC1.

[0083] The output from counters 74-81 are “tristated” so that only oneuses the bus DATA at one time. Referring to the flow chart of FIG. 7A,it shows the sequence of operations of state machine 70. Wheninitialized, state means 70 starts at step S1 (FIG. 7A). Loop I startswith a branching decision. If a transition occurs (signal DEC) and thescan is not over, branches S1 and S2 transfer control to steps S3 and S4so that a byte of values indicating a bit pattern of bars and spaces isloaded into memory 48. The string data counter 82 which points to theappropriate address is incremented.

[0084] If at the next transition all scanning is completed, then loop IIis executed. In loop II, the state machine 70 successively stores bytesof interval pattern data and then increments the address pointer. StepsS5 and S6 are essentially the same as previously described steps S3 andS4. In the following steps S7 and S8, the string length of counter 80 iswritten into memory 48 along data bus DATA. String qualifier bytecounter 84 is incremented. Next, in steps S9 and S10, narrow value latch81 is loaded into memory 48 along data bus DATA. The string qualifierbyte counter 84 is incremented to indicate the next position. In stepsS11 and S12, the value in label position counter 76 is loaded along busDATA into memory 48 and counter 84 is incremented. In steps S13 and S14,the bad scans counter 74 is loaded into memory 48 along bus DATA andcounter 84 is again incremented.

[0085] If the scan has ended, loop III is executed so that the scannumber stored in counter 78 is loaded into memory 48 along bus DATA tothe address indicated by counter 84 which is then incremented.

[0086] The actual control signals for registers and memory interface areimplemented in the state means 70. The function of various timing eventsare described below:

[0087] WINDOW: Indicates a save of the current string. This occurs ifthe minimum string length of five is exceeded. This signal resets at theend of the string.

[0088] SAVSD (L5): Indicates a byte of string data was saved. Thisoccurs when the eight-bits shift register is full or when the string isended.

[0089] SAVALL (L3): Indicates all data was saved (i.e.: string data,string length, narrow value, label position, and the number of badscans). This signal is active if the string is ended.

[0090] SLEQCR (L1): Determines whether the String Length Counter 80 isloaded with a “1” or the number of consecutive equal WIDE/NARROWS. Itchooses a “1” if the string is ended or no string is being saved. Itchooses later if the comparison to a wide is twice or comparison to anarrow is half AND the current string is not being saved.

[0091] LDSLC/(L2): Synchronous load of String Length Counter (SLC).Occurs if the current string is being saved or if the comparison isJUNK.

[0092] LDEQ/(L4): Synchronously loads a “1” into the Consecutive EqualCounter (CEC). Occurs if the comparison is not equal.

[0093] JUNK: Occurs if the comparison is not half, equal or twice. Italso occurs if the bar/space width exceeds the preset limits.

[0094] SELREG2 (Mux_sel): Selects register 52B or register 52C for anadjacent or alternate comparison, respectively. It chooses the adjacentcomparison if in state A and comparison is JUNK. It chooses later ifcomparison is not JUNK.

[0095] Because the state machine 70 is arranged as just described, eachstate either proceeds to the next state or does not change. Also thenext state is always a new state and never a previous state. Thisensures that within one iteration, no state can be active more than onetime.

[0096] Referring to FIG. 7B, it shows the operation associated with themicroprocessor board 42 of FIG. 3, when scan data is available. The flowchart in FIG. 7B is executed starting at S20, to read the scanned databytes. Next in step S21, the string qualifier data is read: the scancount number, the string length, the narrow value, the label positionand the number of bad scans. Next in step S22, the microprocessordetermines whether the latest scan is equivalent to the earlier scans inlabel position value and narrow width value. If it is not, controlreturns to step S20; otherwise, control is given to step S23. In stepS23, the microprocessor shifts the latest bit pattern with respect toprior bit patterns to see whether there is a matching subinterval. Ifthere is, control is shifted to step S24; otherwise control reverts tostep S20. Steps S24 and S25 are executed to store the reconstructedstring. If the reconstructed string is sufficiently long, themicrocomputer indicates that a complete and valid code has beenassembled. This valid code once assembled, can be used in a conventionalmanner.

[0097] It will be appreciated that various modifications and alterationscan be made to the apparatus just described. For example, while three“X” patterns are illustrated, a different number can be used. Scanninggeometries other than an “X” pattern may also be used. For example, asingle line may be used if the code passes through the line at a shallowenough angle. A circle may be used if the code is constrained to thecircumference of a circle. Two or more intersecting line segments may beused if the code passes through at least one of them at a shallow enoughangle. Any of these scan patterns may be rastered to increase their areaof coverage. The arrangement and use of mirrors can be altered dependingupon the desired mode of slewing the laser beam.

[0098] While the comparison between data strings is conditioned onhaving corresponding label positions and narrow values, in otherembodiments different comparisons or no comparisons may be employed. Thetolerance placed on the ratios of current to former interval widths canbe varied depending upon the expected accuracy of the printed codes.While optically-readable printed labels are described, it will beunderstood that other media such as magnetic media may be employedinstead. The illustrated digital circuits can be composed of larger orsmaller scale integrated circuits without departing from the scope ofthe present invention, and can be composed of arrays as shown or may insome embodiments employ another independent microprocessor or digitalsignal processor. Also the speed and the dimension of the scan can bealtered depending upon the particular application.

[0099] It is even possible to alter the sequence in which various stepsare performed. For example, FIG. 8A schematically summarizes the systemearlier described in conjunction with FIGS. 1 to 7 of the drawings.Thus, a scanner 100 is provided for optically scanning themachine-readable code, providing electrical signals for furtherprocessing. Such processing includes the development of specifiedcounts, at 101, followed by the compression (i.e., conversion) of datainto digital form, at 102. The compressed data is then shifted andmatched, at 103, to recreate the scanned bar code (from discreteportions which have been read). The reconstructed bar code is thendecoded, at 104, providing the desired output. Thus, by means of digitalcomparison, a complete bar code can be reconstructed from two or morediscrete fragments as previously described.

[0100]FIG. 8B shows an alternative sequence of steps for scanning a barcode. Once again, a scanner 100 is provided for optically scanning themachine-readable code. This is again followed by the development ofspecified counts, at 101′. However, unlike the system of FIG. 8A, thesystem of FIG. 8B then operates to shift and match the scanned data, at105, based upon the counts which have been developed, to reconstruct thebar code. The reconstructed bar code is then decoded (compressed todigital form and decoded), at 104′, providing the desired output. Thus,a complete bar code can in this case be numerically reconstructed fromtwo or more discrete fragments. Further detail regarding thisalternative technique for reading machine-readable code is providedbelow.

[0101] Scanning (at 100) of the machine-readable code is accomplished ina manner which substantially corresponds to that previously described inconnection with the system schematically illustrated in FIG. 8A, orusing some other appropriate scanning pattern, so that “slices” of thebar code are read by the scanner as the bar code passes the scanner.Generally, no one slice will contain a complete bar code, and aplurality of slices will have to be processed to reconstruct thecomplete bar code. To this end, the scanner provides three outputsignals. A CART signal is provided to indicate that an object hasentered the scan area. A SCAN signal is provided at the beginning of thescan pattern, and is discontinued at the end of the scan pattern. A CODEsignal indicates black and white areas within each scan.

[0102] These signals are then applied to the pulse-counting portions101′ of the system. During each scan, pulse width counts (PWC) aregenerated to represent the widths of the black and white sectionsidentified by the CODE signal. Each fragment (slice) of the bar codewill therefore generate a plurality of bars (black) and spaces (white),producing a succession of counts (for each bar and space) incremented atthe system's clock frequency. To be noted is that these pulse widthcounts are generated in real time, as is preferred, although otherimplementations are possible (provided appropriate buffers are madeavailable between the scanning operation and the subsequent processingoperations which are described below).

[0103] In addition to the development of pulse width counts, anadditional counter is started at the beginning of each scan (i.e., resetto “0”) to develop an absolute position counter. During the scan, thiscounter is also incremented at the system's clock frequency, reaching amaximum value at the end of each scan. Thus, the absolute positioncounter functions to indicate the location of the pulse width countscollected during each scan. To this end, on each black to whitetransition, the content of the absolute position counter is latched toidentify the transition position count (i.e., location), while on eachwhite to black transition, the pulse width count of the previous bar,the pulse width count of the previous space, and the transition positioncount for the pair, are saved (in memory) for further processing.Transfers of pulse width counts and transition position counts to memoryare done in real time making use of a DMA (direct memory access)process.

[0104] An alternative approach to this would be to make use of a single,high speed counter which starts at zero at the start of a scan, andwhich counts to some maximum value at the end of the scan. The contentof the counter would then be stored for each transition of the CODEsignal, with simple subtraction of one value from the next serving toprovide an accurate indication of bar-pulse-width counts,space-pulse-width counts, and transition position counts (for subsequentprocessing).

[0105] Following each scan, all data for the scan is processed todetermine if one or more series of pulse width counts (strings)constitute part of a possible valid bar code. Any string which exceeds acertain minimum length meeting this criteria is stored in memory. Thisprocess is repeated at the end of every scan while the object to bescanned is in the scanning area. Between the end of this process and theend of the next scan, steps are taken to recreate the bar code in memorymaking use of the pulse width counts and transition position countswhich have been developed.

[0106] Referring now to FIGS. 9A and 9B, the first step in this processis to check each string, at 110, to find a string which contains a validbeginning portion (start) or ending portion (stop) of a bar code, at111. It is important to note that since this can be recognized whetherthe pattern is in a forward or a backward orientation, or anywherewithin the string, a white area (so-called “quiet zone”) around the barcode is not required. When a valid start or stop pattern is found, thecorresponding string is used to form the first string of a “cluster”, at112. To be noted is that plural clusters may be started, and that asingle string can lead to the creation of more than one cluster. Furtherto be noted is that since the strings of each scan are processed in theorder in which they are transferred to memory, plural clusters may beprocessed in parallel.

[0107] Upon the formation of a cluster, at 112, a valid middle portionof the first string is identified. The transition position count forthis valid middle portion is then recorded and a range (plus/minus) iscreated. Following this, the next scan is searched, at 113, for a stringwhich matches (test 114) at least part, if not all of the previousstring in the cluster. To prevent a mismatch, only the part of the nextstring which falls within the transition position count range of theprevious string is used. It is possible that no string from thesubsequent scan will fit within the range which has been selected, inwhich case a string from the following scan will be analyzed. If after afew scans, no matching string can be found (test 115), the cluster isdiscarded, at 116, and another is analyzed.

[0108] The above-described matching process is summarized as follows.The strings of each scan are represented as a series of pulse widthcounts (i.e., bar, space, bar, space, etc.). The second string isshifted to each possible location within the calculated range specifiedfor the first string. A comparison is then made between the pulse widthcounts for both strings in each possible location. To improve theaccuracy of this comparison, adjacent bars and spaces are preferablysummed so that a bar and an adjacent space create a bar/space pair whilethat same space and the next adjacent bar create a space/bar pair (andso on), which are then used for comparison purposes. Alternatively, abar can be matched to a bar, and a space can be matched to a space. Inany event, as the data is relatively shifted and comparisons are made,the pulse width counts of both strings will eventually match (i.e., thepulse width counts will fall within an acceptable tolerance),identifying a registered middle portion of adjacent strings (fragments)of a scanned bar code.

[0109] To be noted is that it is not necessary to match the entirestring, but only some middle portion containing at least a predefinedminimum number of bar/space pairs. This allows for non-bar-code data oneither end of the strings, eliminating the need for a quiet zone aroundthe label.

[0110] Once a match is found, the second string is added to the first(the cluster), at 117. To this end, the pulse width counts which matchare preferably averaged together to create a longer string containingmore of the bar code than either string would separately constitute.This string is then preferably decoded to identify at least a part ofthe bar code and confirm that the shift and match procedure wascorrectly accomplished. This process is than repeated for successivescans (loop 118), each time creating a longer string containing more ofthe bar code being scanned.

[0111] Eventually, a string will be added to the cluster which containsthe end (stop) portion of the bar code, assuming that the beginning(start) portion led to the creation of the cluster, or the beginning(start) portion of the bar code, assuming that the end (stop) portionled to the creation of the cluster. When this is detected, at 119, asingle string of pulse width counts containing an entire bar code willhave been formed, and the cluster is closed, at 120. The final string isthen decoded, at 121, to complete the reconstructed bar code. As afurther test, at 122, additional strings from subsequent scans (if any)are preferably matched with the completed string to make sure that thereis no overrun, and that the assembled cluster is in fact a complete barcode and not part of a larger bar code which has not yet been completelyreconstructed. If an overrun occurs, the cluster is reopened so that abar code of greater length may be decoded. Otherwise, the cluster isdiscarded, at 123. If no overrun occurs, the cluster is deemed completeand a valid bar code has been decoded.

[0112] This same procedure is repeated, at 124, for each cluster whichhas been formed. Each identified cluster is either completed ordiscarded, as previously described. This allows for multiple bar codesto be decoded, and for another section of the pattern developed by thescanner (e.g., an “X”) to again decode the same label.

[0113] The foregoing operations contribute to various advantages inoperation. For example, as previously indicated, no quiet zone isrequired on any side of the label. Rather, pulse width countsrepresenting non-bar-code data on the ends of the strings are simplyignored during the shifting and matching procedure. This also has theadvantage that even badly damaged bar codes can still be recreated. Whatis more, strings which are damaged can be salvaged if the section whichfalls within the transition position count range is nevertheless valid.Otherwise the string is ignored and the next string is analyzed. It isnot necessary that all partial strings be used to recreate a particularbar code.

[0114] Another advantage is that multiple labels on a single object cannow be decoded, whether or not the labels are of the same code typeand/or length. The absolute position counter produces highly accuratetransition position counts for each bar/space pair, ensuring validstring matches and allowing for separate bar codes as close as 0.25inches to be decoded.

[0115] Yet another advantage is that except for the initial scanningprocedure, and transitional hardware necessary for the counting andmemory transfer procedures, the above described system can be fullyimplemented in software. A computer program listing which implements theforegoing processing steps is attached as an appendix following thisspecification. This program is advantageously implemented in a RISC(Reduced Instruction Set Computer) processor, preferably that availablefrom Texas Instruments under the model number TMS320C30, providing stillfurther advantages in accordance with the present invention.

[0116] In any event, it will be appreciated that various modificationscan be implemented to the above described embodiment and that theforegoing shall be considered illustrative and that variousmodifications thereto will not depart from the scope and spirit of thepresent invention.

What is claimed is:
 1. A method for processing scanned code data todetermine whether the scanned code data is part of a valid code, thescanned code data including a plurality of strings, the methodcomprising the steps of: examining a first string of a first scannedcode data; opening a cluster with the first string if the first stringcontains a start pattern; identifying at least one valid middle portionof the first string; storing a transition position count associated withthe at least one valid middle portion; searching a second scanned codedata for a second string matching at least part of the first string inthe cluster; adding the second string to the end of the cluster; closingthe cluster upon detection of a stop pattern; and decoding the cluster.2. The method according to claim 1, wherein the searching step includes:searching a predetermined number of strings for a match; and if no matchis found after searching the predetermined number of strings, thendiscarding the cluster and returning to the examining step.
 3. Themethod according to claim 1, wherein: the storing step includes creatinga range around the transition position count of the first string; andthe searching step includes matching the transition position count ofthe second string with the transition position count range of the firststring.
 4. The method according to claim 3, wherein each string is aseries of pulse width counts and the searching step includes: shiftingthe second string to each possible location within the transitionposition count range of the first string; and comparing the pulse widthcount of the second string in each position with the pulse width countof the first string, whereby the strings match when the pulse widthcount of both strings match.
 5. The method according to claim 4, whereinthe adding step includes averaging the matching pulse width countstogether to create a longer cluster.
 6. The method according to claim 1,further comprising the step of: confirming that the cluster contains acomplete code.
 7. The method according to claim 6, wherein theconfirming step includes reopening the cluster if the cluster does notcontain a complete code.
 8. The method according to claim 1, wherein:the start pattern is the beginning of a code data; and the stop patternis the end of the code data.
 9. The method according to claim 2,wherein: the start pattern is the end of a code data; and the stoppattern is the beginning of the code data.
 10. A method for processingscanned code data, comprising the steps of: (a) reading scanned codedata; (b) reading string qualifier data, including a label positionvalue and a narrow width value; (c) determining whether the currentscanned data is equivalent to earlier scanned data with the same labelposition value and narrow width value; (d) if the current scanned datais not equivalent to earlier scanned data, then returning to step (a);(e) if the current scanned data is equivalent to earlier scanned data,then shifting the current scanned data with respect to the earlierscanned data to determine whether a matching subinterval exists; (f) ifno matching subinterval exists, then returning to step (a); (g) if amatching subinterval exists, then storing the shifted current scanneddata as a string.
 11. A method for constructing fragments of electronicdata into a meaningful information stream, the method comprising thesteps of: (a) examining a first fragment for a start pattern; (b)opening a cluster with the first fragment if it contains a startpattern; (c) identifying at least one portion of the first fragment as avalid middle portion; (d) storing a transition position count associatedwith a valid middle portion; (e) examining a second fragment todetermine if it has a second portion matching at least part of the firstfragment in the cluster; (f) adding a matching second portion to the endof the cluster; (g) repeating the steps (e) and (f) until a stop patternis identified; and (h) closing the cluster upon detection of a stoppattern.
 12. The method according to claim 11, wherein step (e)includes: examining a predetermined number of fragments for a match; andif no match is found after examining the predetermined number offragments, then discarding the cluster and returning to step (a). 13.The method according to claim 11, wherein: step (d) includes creating arange around the transition position count of the first fragment; andstep (e) includes matching the transition position count of the secondfragment with the transition position count range of the first fragment.